﻿@model LyyCMS.Core.Models.Blog

@{
    ViewData["Title"] =  Model.Title;
}
<div class="row">
    <div class="col-md-8">
        <div class="card article shadow p-3 mb-5 bg-white rounded">
            <div class="page-header">
                <h1>@Model.Title <small style="float:right; font-size:50%;">@Model.Create_At</small></h1>
                分类：<span class="label label-success">@Html.DisplayFor(model => model.Category)</span>
            </div>
            <hr />
            <div class="content">
                @Html.DisplayFor(model => model.Content)
            </div>

        </div>

        <div style="margin:10px;">
            <h3>评论</h3>
            @if (Model.Comments != null)
            {
                @foreach (var comment in Model.Comments)
                {
                    <div class="card comment">
                        <div class="card-header">
                            <h3 class="card-title">@comment.Title <span style="float:right">@comment.Create_At</span></h3>

                        </div>
                        <div class="card-body">
                            @comment.Comment
                        </div>

                    </div>
                    <div style="width:100%; height:5px;clear:both;"></div>
                }
            }
        </div>
        <div>
            <a asp-action="Index">返回列表</a>
        </div>

    </div>
    <div>
        <div class="card">
            <div class="card-header">
                <div class="card-title">分类</div>
            </div>

            <div class="card-body">
                <ul class="nav flex-column">
                    @foreach (var cate in Html.GetEnumSelectList(typeof(LyyCMS.Core.Models.BlogCategory)))
                    {
                        <li class="nav-item">
                            <a class="nav-link" asp-action="Index" asp-route-cate="@cate.Value" asp-route-page="1">@cate.Text</a>
                        </li>
                    }

                </ul>
            </div>
        </div>
    </div>
</div>
